package cn.hl.sfzy.service.impl;

import cn.hl.sfzy.entity.ConsultSpecialty;
import cn.hl.sfzy.mapper.ConsultSpecialtyMapper;
import cn.hl.sfzy.service.ConsultSpecialtyService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Date 2024年10月23日
 */
//取消所有黄色警告
//@SuppressWarnings("all")
@Service
public class ConsultSpecialtyServiceImpl implements ConsultSpecialtyService {
    @Autowired
    private ConsultSpecialtyMapper consultSpecialtyMapper;

//    public int add(ConsultSpecialty consultSpecialty) {
//        return consultMapper.insert(consultSpecialty);
//    }
//
//    public int remove(Long[] id) {
//        return consultMapper.remove(id);
//    }
//
//    public int edit(Consult consult) {
//        return consultMapper.updateByPrimaryKeySelective(consult);
//    }

    public List<ConsultSpecialty> find(ConsultSpecialty consultSpecialty) {
        return consultSpecialtyMapper.find(consultSpecialty);
    }

    @Override
    public PageInfo<ConsultSpecialty> findByPage(int pageNum, int pageSize, ConsultSpecialty consultSpecialty) {
        PageHelper.startPage(pageNum, pageSize);
        List<ConsultSpecialty> consultSpecialties = consultSpecialtyMapper.find(consultSpecialty);
        return new PageInfo<>(consultSpecialties);
    }


}
